<%--
  author: qingx
  date: 2018/11/22
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <!-- jsp文件头和头部 -->
    <%@ include file="../base/top.jsp"%>
</head>
<body class="no-skin">
<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">
    <!-- /section:basics/sidebar -->
    <div class="main-content">
        <div class="main-content-inner">
            <div class="page-content">
                <div class="hr hr-18 dotted hr-double"></div>
                <div class="row">
                    <div class="col-xs-12">

                        <div>
                            <a target="mainFrame" onclick="toCreateTeachCourse()">
                                <div class="create" style="text-align: right">
                                    <label><font size="4">+ 创建课程</font></label>
                                </div>
                            </a>
                            <%--<div style="text-align: left">--%>
                                <%--<label>--%>
                                    <%--<input name="form-field" class="radio" id="type" type="radio"--%>
                                           <%--onclick="changeType(this)" value="0" style="float:left;">--%>
                                    <%--<span class="lbl">查看全部课程</span>--%>
                                <%--</label>--%>
                            <%--</div>--%>
                        </div>

                        <div align="left" >
                            <ol id="ol" style="list-style:none">
                            </ol>
                        </div>
                        <%@ include file="../page/pagingbar.jsp"%>

                    </div>
                    <!-- /.col -->
                </div>
                <!-- /.row -->
            </div>
            <!-- /.page-content -->
        </div>
    </div>
    <!-- /.main-content -->
    <!-- 返回顶部 -->
    <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
        <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
    </a>

</div>
<!-- /.main-container -->
<!-- basic scripts -->
<!-- 页面底部js¨ -->
<%@ include file="../base/foot.jsp"%>

<script type="text/javascript">
    $(top.hangge());
    $(document).ready(function() {
        var url = 'teach_course/search_teach_course_details';
        var param = {};
        var field = {sortField:'teach_course_name',
            orderDir:'desc',limit:[1,2,3]};
        var loadPage = LoadPage($('#ol'),url,param,field,
            function (data) {
                var li =
                    $("<li style='display: inline-block;'> " +
                        "<div style='width: 195px; height: 200px; margin: 8px;'> " +
                        "<a id='"+data.teachCourseId+"' style='cursor:pointer; text-decoration: none;' target='mainFrame'>" +
                        "<div class='"+data.teachCourseIcon+"' style='width: 195px; height: 200px; '><div style='padding: 10px;'>" +
                        "<div class='col-xs-12'style='height: 20px; text-align: center; font-size: 18px;'>"+data.courseInfo.courseName+
                        "</div>"+
                        "<div class='col-xs-6' style='margin-top: 40px;  text-align: left; '>"+data.teacherInfo.teaName+
                        "</div>"+
                        "<div class='col-xs-6' style='margin-top: 40px;  text-align: right; '>"+ data.teachCourseName.split("+")[1]+
                        "</div>"+
                        "</div><div class='col-xs-12' style='padding: 15px;width: 195px; height: 112px; background-color: #eef0eb'>"+
                        "<p class='clamp' style='word-break:break-all;color: #0e0e0e'>"+data.courseInfo.courseDescription+
                        "</p>"+
                        "</div></div>"+
                        "</a></div></li>");
                return li;
            },
            {
                row:function(data) {
                    delete data.teacherInfo;
                    delete data.stageInfos;
                    var url = 'teach_course/to_teach_course_detail?'+parseParam(data);
                    $("#"+data.teachCourseId).click(function () {
                        addTab('1','1','课程详情',url);
                    });
                },
                all:function(data) {
                    clamp('.clamp',4);
                }
            }
        );
    });

    function toCreateTeachCourse() {
        window.location.href = "teach_course/toCreateTeachCourse";
    }

    function changeType(radioObj){
        if(radioObj.value==1){
            alert(radioObj.value);
            radioObj.value=0;
            radioObj.checked=0;
        }else{
            alert(radioObj.value);
            radioObj.value=1;
        }
    }
</script>
</body>
</html>